package ModelLayer;

/**
 * Write a description of class Person here.
 * 
 * @author Rasmus Andersen Borup 
 * @version 
 */
public class Person
{
    // instance variables
    private long id;
    private static long idNo = 0;
    private String name;
    private String address;
    private int postalCode;
    private String city;
    private String phone;

    /**
     * Constructor for objects of class Person
     */
    public Person(String name, String address, int postalCode, String city, String phone)
    {
        // initialising instance variables
        idNo++;
        id = idNo;
        this.name = name;
        this.address = address;
        this.postalCode = postalCode;
        this.city = city;
        this.phone = phone;
    }
    
    /**
     * Return the value of variable id
     */
    public long getId()
    {
        return id;
    }

    /**
     * Return the value of variable name
     */
    public String getName()
    {
        return name;
    }

    /**
     * Return the value of variable address
     */
    public String getAddress()
    {
        return address;
    }

    /**
     * Return the value of variable postalCode
     */
    public int getPostalCode()
    {
        return postalCode;
    }
    
    /**
     * Return the value of variable city
     */
    public String getCity()
    {
        return city;
    }

    /**
     * Return the value of variable phone
     */
    public String getPhone()
    {
        return phone;
    }
        
    /**
     * Sets a new value for variable id
     */
    public void setId(long id)
    {
        this.id = id;
    }
    
    /**
     * Sets a new value for variable name
     */
    public void setName(String name)
    {
        this.name = name;
    }
        
    /**
     * Sets a new value for variable address
     */
    public void setAddress(String address)
    {
        this.address = address;
    }
    
    /**
     * Sets a new value for variable postalCode
     */
    public void setPostalCode(int postalCode)
    {
        this.postalCode = postalCode;
    }
    
    /**
     * Sets a new value for variable city
     */
    public void setCity(String city)
    {
        this.city = city;
    }

    /**
     * Sets a new value for variable phone
     */
    public void setPhone(String phone)
    {
        this.phone = phone;
    }
    
    public void printInfo()
    {
        System.out.println("ID: " + id);
        System.out.println("Name: " + name);
        System.out.println("Address: " + address);
        System.out.println("Postal code: " + postalCode);
        System.out.println("City: " + city);
        System.out.println("Phone number " + phone);
    }
}